package qsoft.omanga.ui;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

import java.util.List;

import qsoft.omanga.business.component.MangaBusiness;
import qsoft.omanga.business.entities.Manga;
import qsoft.omanga.ui.adapter.MangaAdapter;

/**
 * 
 * @author sontt
 * 
 */
public class HomeActivity extends Activity {
    /**
     * 
     */
    private MangaBusiness mangaBusiness;
    /**
     * 
     */
    private ListView listViewManga;
    /**
     * 
     */
    private MangaAdapter mangaAdapter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.home);
        mangaBusiness = new MangaBusiness(this.getApplicationContext());
        List<Manga> listMangas = mangaBusiness.getListNewFromService();

        listViewManga = (ListView) findViewById(R.id.listManga);
        mangaAdapter = new MangaAdapter(this.getApplicationContext(),
                listMangas, true);
        listViewManga.setAdapter(mangaAdapter);
    }
}
